package com.tengjunjie.qianqianaccountbook.qianqianaccountbook.mapper;


import com.tengjunjie.qianqianaccountbook.qianqianaccountbook.entity.UserEntity;
import com.tengjunjie.qianqianaccountbook.qianqianaccountbook.mapper.sql.UserSql;
import org.apache.ibatis.annotations.*;


/**
 * Created by tengjunjie on 2017/12/3.
 */
public interface UserMapper {
//    @Select("SELECT * FROM users")
//    @Results({
//            @Result(property = "userSex",  column = "user_sex"),
//            @Result(property = "nickName", column = "nick_name")
//    })
//    List<UserEntity> getAll();
//
//    @SelectProvider(type = UserSql.class, method = "getList")
//    List<UserEntity> getList(UserDTO userParam);
//
//    @SelectProvider(type = UserSql.class, method = "getCount")
//    int getCount(UserDTO userParam);
//
//    @Select("SELECT * FROM users WHERE id = #{id}")
//    @Results({
//            @Result(property = "userSex",  column = "user_sex", javaType = UserSexEnum.class),
//            @Result(property = "nickName", column = "nick_name")
//    })
//    UserEntity getOne(Long id);

    @Insert("INSERT INTO user(id,name,phone,emailAddress,sex,image,passWord,roleId,status,description,createTime,updateTime) VALUES(#{id}, #{name}, #{phone},#{emailAddress},#{sex},#{image},#{passWord},#{roleId},#{status},#{description},#{createTime},#{updateTime})")
    void insert(UserEntity user);

//    @Update("UPDATE users SET userName=#{userName},nick_name=#{nickName} WHERE id =#{id}")
//    void update(UserEntity user);
//
//    @Delete("DELETE FROM users WHERE id =#{id}")
//    void delete(Long id);
}
